'''
Created on 06/ago/2010

@author: rbutti
'''

import os
from google.appengine.dist import use_library
from google.appengine.ext.webapp import util    # Google App Engine imports.

use_library('django', '1.1')
os.environ['DJANGO_SETTINGS_MODULE'] = 'ilts.settings'  # Force Django to reload its settings.
                                                        # Must set this env var before importing any 
                                                        # part of Django
                                                        # 'ilts' is the name of the project 
                                                        # created with django-admin.py

from django.conf import settings
settings._target = None
import django.core.handlers.wsgi

def main():
    # Create a Django application for WSGI.
    application = django.core.handlers.wsgi.WSGIHandler()

    # Run the WSGI CGI handler with that application.
    util.run_wsgi_app(application)

if __name__ == '__main__':
    main()
